<div style="min-width:1000px;">
<nz-breadcrumb class="breadcrumb-pos">
  <i nz-icon type="link" theme="outline" style="color:#1890FF;padding-right:4px"></i>
  <nz-breadcrumb-item>
    租户账单
  </nz-breadcrumb-item>
</nz-breadcrumb>
<div nz-row [nzGutter]="16" style="border-bottom: 1px solid #ccc;margin-bottom: 8px;min-width: 800px;">
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>账单编号</nz-form-label>
      <nz-form-control>
        <input nz-input [(ngModel)]="billId">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>租赁客户</nz-form-label>
      <nz-form-control>
        <input nz-input [(ngModel)]="companyName">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>调度员</nz-form-label>
      <nz-form-control>
        <input nz-input [(ngModel)]="yard">
      </nz-form-control>
    </nz-form-item>
  </div>
  <div nz-col [nzSpan]="5">
    <nz-form-item nzFlex>
      <nz-form-label>是否支付</nz-form-label>
      <nz-select [(ngModel)]="isPay" style="margin-top:3px;">
        <nz-option [nzLabel]="'全部'" [nzValue]="''"></nz-option>
        <nz-option [nzLabel]="'未支付'" [nzValue]="'0'"></nz-option>
        <nz-option [nzLabel]="'已支付'" [nzValue]="'1'"></nz-option>
      </nz-select>
      <button nz-button [nzType]="'primary'" [nzLoading]="btn_loading" style="margin:3px 0 0 20px;" (click)="getBilllist()">查询</button>
    </nz-form-item>
  </div>
</div>

<div class="add_btn">
  <button nz-button style="float:right" (click)="exportOut()">导出Excel</button>
</div>
<nz-table #basicTable [nzData]="billlist" [nzLoading]="loading" [nzShowPagination]="false" [nzBordered]="true">
  <thead>
    <tr>
      <th>账单编号<hr>租赁客户</th>
      <th>是否支付<hr>支付时间</th>
      <th>套餐金额</th>
      <th>打印总金额</th>
      <th>总金额<hr>应付金额</th>
      <th>打印量/张<hr>黑白 / 彩色</th>
      <th>套餐量/张<hr>黑白 / 彩色</th>
      <th>结算日期</th>
      <th>调度金额<hr>调度时间</th>
      <th>调度员</th>
      <th nzWidth="90px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of billlist">
      <td>{{data.number}}<hr>{{userinfo[data.userId].companyName}}</td>
      <td>{{data.isPay?"已支付":"未支付"}}<hr>{{data.payDate?data.payDate.slice(0,10):"--"}}</td>
      <td>{{data.setMealMoneySum}}</td>
      <td>{{data.printMoneySum}}</td>
      <td>{{data.sumMoney}}<hr>{{data.payableMoney}}</td>
      <td>{{data.blackYieldSum}}/{{data.coloursYieldSum}}</td>
      <td>{{data.blackPresentedSum}}/{{data.coloursPresentedSum}}</td>
      <td>{{data.clearingDate.slice(0,10)}}</td>
      <td>{{data.dispatchMoney}}<hr>{{data.dateUpdate?data.dateUpdate.slice(0,10):"--"}}</td>
      <td>{{data.acountId !==-1?yardinfo[data.acountId].name:"--"}}</td>
      <td>
        <a style="color:rgb(24, 223, 230);margin-right: 10px;" (click)="jiab(data.id)">加币</a>
        <a style="color:rgb(24, 223, 230);" (click)="jianb(data.id,data.sumMoney)">减币</a>
        <br>
        <nz-popconfirm *ngIf="!data.isPay" [nzTitle]="'确定要该账单已支付么?'" (nzOnConfirm)="bePay(data.id)">
          <a nz-popconfirm style="color:rgb(24, 120, 230);">已支付</a>
        </nz-popconfirm>
      </td>
    </tr>
  </tbody>
</nz-table>
<nz-pagination style="float:right;margin-top:12px" [nzPageIndex]="PageIndex" [nzPageSize]="PageSize" [nzTotal]="PageTotal" (nzPageIndexChange)="PageIndexChange($event)" [nzHideOnSinglePage]="true" [nzShowTotal]="totalTemplate"></nz-pagination>
<ng-template #totalTemplate let-total>
  共 {{total}} 条数据
</ng-template>
<nz-modal [(nzVisible)]="jiaIsVisible" nzTitle="加 币" (nzOnCancel)="jiaHandleCancel()" (nzOnOk)="jiaHandleOk()">
  <nz-form-label nzRequired nzFor="jjbValue">加币额度</nz-form-label>
  <nz-input-number style="width:100%;" [nzMin]="0" [(ngModel)]="jiabValue" (nzFocus)="jiaFocus()" [nzPlaceHolder]="'请输入加币金额'"></nz-input-number>
  <nz-form-explain class="checkResult" *ngIf="jiabcode==-1">请输入加币金额!</nz-form-explain>
</nz-modal>
<nz-modal [(nzVisible)]="jianIsVisible" nzTitle="减 币" (nzOnCancel)="jianHandleCancel()" (nzOnOk)="jianHandleOk()">
  <nz-form-label nzRequired nzFor="jjbValue">减币额度</nz-form-label>
  <nz-input-number style="width:100%;" [nzMin]="0" [(ngModel)]="jianbValue" (nzFocus)="jianFocus()" [nzPlaceHolder]="'请输入减币金额'"></nz-input-number>
  <nz-form-explain class="checkResult" *ngIf="jianbcode==-1">请输入减币金额!</nz-form-explain>
</nz-modal>
</div>